//API统一管理
import requests from './request';
import mockRequests from './mockAjax';

//三级联动接口
export const reqCategoryList = () => requests({ url: '/product/getBaseCategoryList', method: 'get' })

//获取轮播图图片
export const reqGetBannerList = () => mockRequests({ url: '/banner', method: 'get' })

//获取验证码
export const reqGetCode = (phone) => requests({ url: `/user/passport/sendCode/${phone}`, method: 'get' })

//注册(POST)
export const reqUserRegister = (data) => requests({ url:'/user/passport/register', data, method:'post'})

//登入(POST)
export const reqUserLogin = (data) => requests({ url:'/user/passport/login', data, method:'post'})

//带着用户token获取用户信息
export const reqUserInfo = () => requests({url:'/user/passport/auth/getUserInfo', method:'get'})

//退出登入
export const reqLogout = ()=> requests({url:'/api/user/passport/logout', method:'get'})